home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
151-175
/
scopedisk168
/
tinytools
/
clip
/
clip.man
< prev
next >
Wrap
Text File
|
1995-03-19
|
2KB
|
51 lines
NAME
Clip - Pipe through clipped lines.
SYNOPSIS
Clip <Cnt1> [ID1 [x]"charlist"] <Cnt2> [ID2 [x]"charlist"]
REQUIREMENTS
The ARP library
DESCRIPTION
Clip is a flexible tool for clipping pieces out of input lines.
Two clip positions may be specified, and, for every input line,
the text between the clip positions is written to the standard
output.
The first clip position is relative to the leftmost byte for
positive count values, and relative to the rightmost byte for
negative ones. The CNTth byte matching any of the bytes in the
ID's character list is the clip position.
If the ID string is headed by an "x", the character at the
clip position will be excluded from the clip. If no bytes are
specified in the character list, clip will match any byte. Clip
will default to this if you omit the ID parameter.
If a clip position couldn't be matched, no clip will be written.
If, however, no ID is specified, the clip position will be at the
last byte matched. For large CNT values this will probably be the
first or last byte of the input line.
Empty lines are ignored.
EXAMPLES
Clip <TextFile 0 79
Type only the first 80 columns of a textfile to the console.
This prevents line wraps.
Assume input lines with paths+filenames; Clip -1 ID1 "x:/" +400
will pass through only the filenames, and Clip -1 ID1 ":/" -400
will pass through the paths.
Assign | Search STDIN volumename: NONUM | Clip 0 +1 ID2 "x " |
PForm "Assign %s:" | Execute
This line will clear a set of logical device names specific to a
volume.
BUGS/LIMITATIONS
The counts start from 0. This is counter-intuitive. Think of them
as offsets, the first from the edges, the second from the first.